package com.weds.edpf.core.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.Date;
import java.util.List;

import com.weds.core.base.BaseService;
import com.weds.edpf.core.mapper.WtDevLogMapper;
import com.weds.edpf.core.entity.WtDevLogEntity;

/**
 * @Author sxm
 * @Description WtDevLog管理
 * @Date 2020-06-11
 */
@Service
public class WtDevLogService extends BaseService {

    @Autowired
    private WtDevLogMapper wtDevLogMapper;

    private Logger log = LogManager.getLogger();

	/**
	 * 插入日志
	 * @param lx
	 * @param logType
	 * @param logState
	 * @param moduleId
	 * @param logBz
	 * @param ip
	 * @param glyNo
	 * @return
	 */
	public int insertLog(Integer lx, Integer logType, Integer logState, String moduleId, String logBz, String ip, String glyNo) {

		WtDevLogEntity log = new WtDevLogEntity();
		log.setLx(lx);
		log.setLogType(logType);
		log.setLogState(logState);
		log.setModuleId(moduleId);
		log.setLogBz(logBz);
		log.setLogSj(new Date());
		log.setLogIp(ip);
		log.setGlyNo(glyNo);
		return wtDevLogMapper.insertSelective(log);
	}

    public int insertSelective(WtDevLogEntity record) {
        return wtDevLogMapper.insertSelective(record);
    }

    public int insertBatch(List<WtDevLogEntity> list) {
        return wtDevLogMapper.insertBatch(list);
    }


}
